package com.aaa.dao.czy;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * fileName(类名):ProductDao
 * description(作用):
 * author(作者):czy
 * createTime(创建时间):2020/1/13 10:26
 * version(版本):1.0.0
 */

public interface ProductDao {
    /**
     * 查询所有商品
     * @param shopid
     * @return
     */
    @Select("select * from pms_product where shop_id=#{shopid}")
    List<Map> productList( Integer shopid );

    /**
     * 查询商品类别
     * @param shopid
     * @param categoryid
     * @return
     */
    @Select("select pc.name,p.name a from pms_product p right join pms_product_category pc on p.product_category_id = pc.id where p.shop_id = #{shopid} and  pc.id=#{categoryid}")
    List<Map> productCategory(@Param("shopid") Integer shopid, @Param("categoryid") Integer categoryid);

}
